#include <stdio.h>
#include "Definitions.h"
#include "Simulator.h"
#include "Outports.h"
#include "Inports.h"
#include "Controllers.h"
#include "Signals.h"
#include "Registers.h"
#include "Tracers.h"
#include "Displays.h"
#include "OutportDynamicList.h"

using namespace std;



void Controller_ctrl_paddle::Evaluate(void)
{
    Simulator::OutportList->push_back(Simulator::outPort_paddle_paddle_y);
}

void Controller_ctrl_paddle::Initialize(void)
{
    this->CurrentControlStep = 0;

}



void Controller_test_paddle_ctrl::Evaluate(void)
{
  switch(CurrentControlStep)
{
  case 0:
    CurrentControlStep = 1;
    Simulator::OutportList->push_back(Simulator::outPort_test_paddle_ball_incomming);
    Simulator::OutportList->push_back(Simulator::outPort_test_paddle_ball_y);
    break;
  case 1:
    CurrentControlStep = 2;
    Simulator::OutportList->push_back(Simulator::outPort_test_paddle_ball_incomming);
    Simulator::OutportList->push_back(Simulator::outPort_test_paddle_ball_y);
    break;
  case 2:
    CurrentControlStep = 0;
    Simulator::OutportList->push_back(Simulator::outPort_test_paddle_ball_incomming);
    Simulator::OutportList->push_back(Simulator::outPort_test_paddle_ball_y);
    break;
  default: // should never get here
    throw 
    new ApplicationException();
}
}

void Controller_test_paddle_ctrl::Initialize(void)
{
    this->CurrentControlStep = 2;

}

